package com.hust360.percent.activity;

import com.hust360.percent.R;
import com.hust360.percent.utils.ActivityUtils;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;

public class MoreActivity extends Activity {
	
	/**
	 * 退出程序的按钮
	 */
	Button exitButton;
	
	/**
	 * 用户的按钮
	 */
	TextView userButton;
	
	/**
	 * 修改密码的Button
	 */
	TextView changePasswordBtn;
	
	/**
	 * 关于选项的按钮
	 */
	TextView aboutBtn;
	
	/**
	 * 意见反馈按钮
	 */
	TextView adviseBtn;
	
	
	/**
	 * 检查更新按钮
	 */
	TextView checkUpdateBtn;
	
	/**
	 * 分享设置按钮
	 */
	TextView shareSettingBtn;
	
	/**
	 * 仅在Wifi下显示图片的单选项
	 */
	CheckBox showImageBtn;
	
	/**
	 * 二维码扫描按钮
	 */
	TextView scanCodeBtn;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		ActivityUtils.addActivity(this);
		setContentView(R.layout.activity_more);
		
		findAllViewById();
		
		exitButton.setOnClickListener(new ExitBtnListener());
		
		
	}
	
	/**
	 * 根据ID初始化所有控件
	 */
	private void findAllViewById() {
		exitButton = (Button) findViewById(R.activity_more.exitBtn);
		showImageBtn = (CheckBox)findViewById(R.activity_more.show_img);
		shareSettingBtn = (TextView)findViewById(R.activity_more.share_setting);
		checkUpdateBtn = (TextView)findViewById(R.activity_more.check_update);
		adviseBtn = (TextView)findViewById(R.activity_more.advise);
		aboutBtn = (TextView)findViewById(R.activity_more.about_percent);
		scanCodeBtn = (TextView)findViewById(R.activity_more.scan);
		userButton = (TextView)findViewById(R.activity_more.user);
		changePasswordBtn = (TextView)findViewById(R.activity_more.change_pswd);
	}
	
	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		ActivityUtils.removeActivity(this);
	}
	
	private class ExitBtnListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			ActivityUtils.exit();
		}
		
	}
}
